package com.efuture.mutlithread;

/**
 * @ClassNAME GetCurrentThread
 * @Description 获取当前的线程对象
 * @Author zhaoshanshan
 * @Date 2021/9/9 11:37 下午
 * @Version 1.0
 */
public class GetCurrentThread {

    public static void main(String[] args) {
        Thread t1 = Thread.currentThread();
        System.out.println(t1.getName());
        GetCurrentThreadTest t2 = new GetCurrentThreadTest();
        t2.start();
    }
}
class GetCurrentThreadTest extends Thread{
    @Override
    public void run() {
        Thread t2 = Thread.currentThread();
        System.out.println(t2.getName());
    }
}